export default ({ app, store }) => {
 app.router.beforeEach((to, from, next) => {
    console.log("跳转到页面-->", to.meta.title)
    // console.log("toName", to.name)
    // console.log("from", from.name)
    if (to.name == 'login') {
      store.commit("setBackName", from.name)
    }
    if (window._hmt) {
      if (to.path) {
        window._hmt.push(['_trackPageview', '/#' + to.fullPath])
      }
    }
    // 回到顶部
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0
  
    next()
  })
}